

# setup to allow the module to be imported from the same directory
#   the script is in
import sys
import os
filename = sys.argv[2]
filepath = os.path.dirname(filename)
sys.path.insert(0,filepath)
import OLib as MyLib

import Blender
import Blender.Mathutils
from Blender.Mathutils import *
from Blender import *

image = MyLib.Image('MyScene')
#image.lookFrom(3.5,3,15)
image.lookFrom(15,5,15)
image.lookAt(0,0,1)

# this creates the curve that wraps around the tube path
# this give the tube its 3D appearance
pointList = [[0,0,0],[0,1,0],[1,1,0]]
obSkinShape = image.addCurveLine(pointList=pointList)

# this create the path of interest for the tube
pointList = [[-5,-5,0],[0,5,5],[5,5,5],[-5,0,-5]]
obCurve = image.addCurveLine(pointList=pointList)

# this creates the tube in the image
image.addTube(tubePath=obCurve,tubeShape=obSkinShape,color=[1,0,0])

# this adds a cylinder for comparison and shadows
image.addCylinder(p1=[0,0,0],p2=[0,0,5])

image.save(filepath+'\\images\\'+'test004_Tube.jpg')
